package tech.aistar.mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.pojo.SongList;

import java.util.List;
@Repository
public interface SongListMapper {

    @Select("select * from song_list where song_title like concat('%',#{song_title},'%')")
    List<SongList> findAll(@Param("songTitle") String songTitle);

    @Select("select * from song_list where song_list_id=#{value}")
    List<SongList> findAlllist(Integer id);

    @Select("select * from song_list where album=#{value}")
    List<SongList> findAlllist1(Integer id);

//    @Select("select * from song_list where song_list_id=#{songListId}")
//    List<SongList> getBySId(Integer songListId);

    @Select("select * from song_list where singer_name =#{singerName} order by clicks desc")
    List<SongList> getBySingerName(String singerName);

    @Select("select * from song_list")
    List<SongList> Allfind();
    @Select("select * from song_list where song_title like '%${str}%' or singer_name like '%${str}%'")
    List<SongList> findAllsearch(@Param("str") String str);
    @Select("select * from song_list where song_title like concat('%',#{song_title},'%') and singer_name like concat('%',#{singer_name},'%') and lyrics like concat('%',#{lyrics},'%')")
    List<SongList> selectAll(@Param("songTitle") String songTitle,@Param("singerName") String singerName,@Param("lyrics") String lyrics);


    @Select("select * from song_list where id=#{id}")
    List<SongList> getBySongId(Integer id);
    @Select("select * from song_list where song_title =#{songTitle}")
    SongList getSongBySongTitle(String songTitle);

    @Select("select * from song_list where id=#{id}")
    SongList getBySongI(Integer id);
    @Select("SELECT id,song_title,clicks FROM song_list")
    List<SongList> hotSong();

}
